package cn.codesea.housework_user.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.codesea.housework_user.R;
import cn.codesea.housework_user.entity.Service;

public class Service2Activity extends BaseActivity {

    @BindView(R.id.toolbar)
    Toolbar toolbar;

    @BindView(R.id.desc_tv)
    TextView desc_tv;

    Service service;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_service2);
        ButterKnife.bind(this);
        init();
    }

    private void init(){
        initData();
        initView();
    }

    private void initData(){
        service = (Service) getIntent().getSerializableExtra("service");
    }

    private void initView() {
        // 初始化 toolbar
        toolbar.setTitle(service.getName());
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


        desc_tv.setText(service.getDesc());
    }
}
